﻿using FwtXnaGame3;
using FwtXnaGame3.Engine;
using FwtXnaGame3.Tools;
using GpgCore.Corporations;
using Microsoft.Xna.Framework;

namespace GpgGame.GameObjects.Corps
{
    public class CorpToolBar : GuiGameObject
    {
        public Corporation Corporation
        {
            get { return GodObject.SelectedCorporation; }
        }
        public CityOffice CityOffice
        {
            get { return GodObject.SelectedCityOffice; }
        }

        public CorpToolBar(Scene scene)
            : base(scene, null)
        {
            Sprite = GeneralFactory.CreateOnePxSprite(false, false);
            Transform2D.Opacity = 0.5f;
            Transform2D.Color = Color.Yellow;
            Transform2D.Size = new Vector2(FwtGame3.ScreenWidth, 20);
        }

        public override void DrawGui()
        {
            base.DrawGui();

            if (CityOffice != null && Corporation != null)
            {
                var str = string.Format("{0}, ${1}", Corporation.Name, CityOffice.Money);
                SpriteBatch.DrawText(str, Vector2.One, Color.Black);
            }
        }
    }
}
